package org.example.system.domain.question.dto;

import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

public class DifficultyValidator implements ConstraintValidator<DifficultyValid, Integer> {
    @Override
    public boolean isValid(Integer value, ConstraintValidatorContext context) {
        if (value == null) return true; // 交给@NotNull处理
        return value == 1 || value == 2 || value == 3;
    }
}

